<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Опишете размери</title>
<script src="jquery-2.1.1.min.js"> </script>
<link rel="stylesheet" href="../css/Administration.css" type="text/css">
<script>

function addElement(className){
    
    var parentHTML = $("."+className).filter(":first").html();
    var child = document.createElement("tr");
    child.innerHTML = parentHTML;
    var removeButton = document.createElement("button");
    text = document.createTextNode("Премахни");
    removeButton.appendChild(text);
    $(removeButton).attr("type","button");
    $(removeButton).click(function(){
       $(this).parent().remove();
    
    });
    child.appendChild(removeButton);
    $(child).attr("class",className);
    $("."+className).filter(":last").after(child);
    
}
</script>
</head>
<body>
<div class="container">
<div class="main">
<form action="/Store/DefineSizes" method="post" autocomplete="off">
<table class="center">
<tr class="size">
	<td>Размер:</td> 
	<td> <input type="text" required name="sizes[]"><td>
	<td> <button type="button" onclick="addElement('size')"> Добави </button> </td>
</tr>
<tr>
<td>
<input type="submit" value="Продължи">
</td>
<td class="cancel"> <a href="/Store/Administration.html"> <button type="button"> Отмени </button> </a></td>
</tr>
</table>
</form>	
</div>
</div>
</body>
</html>